import 'dart:async';
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_demo/widget/cards.dart';
import 'package:flutter_demo/widget/screen_load.dart';
import 'package:fluttertoast/fluttertoast.dart';

import 'http/api.dart';
import 'other/application.dart';

class CompanyInfoScreen extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _CompanyInfoScreenState();
}

class _CompanyInfoScreenState
    extends State<CompanyInfoScreen> with ScreenLoadMixin {

  @override
  void initState() {
    super.initState();
    Timer(Duration(milliseconds: 1000), () => loadFinish());
  }

  @override
  Widget buildChild(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('公司信息'),
      ),
      body: Scrollbar(
        child: SingleChildScrollView(
          child: Container(
            alignment: Alignment.center,
            margin: EdgeInsets.symmetric(vertical: 32),
            child: DataWithResourceCard(
              width: 600,
              params: companyInfoData,
            ),
          ),
        ),
      ),
    );
  }

  // void loadData() async {
  //   Response response = await SystemApi.see_company_infor(Application.currentAccount);
  //   if (response.statusCode == 200) {
  //     data = jsonDecode(response.data);
  //     loadFinish();
  //   } else {
  //     Fluttertoast.showToast(msg: response.statusCode.toString());
  //   }
  // }
}